package com.lhl.jpa.domain;

import io.swagger.annotations.Api;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @className: com.lhl.jpa.domain.Book
 * @description: TODO 类描述
 * @author: king
 * @date: 2021-02-05 10:08
 **/
@Api(tags = "Book", produces = "Book")
@Entity
@Data
public class Book implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    private Long id;

    private String title;
    private String isbn;

    @MapsId
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "author_id")
    private Author author;
}
